package com.wx.entity;

/**
 * Created by Max on 2018/4/14.
 */
public class ResultMessage {

    /**
     * 返回消息code
     */
    private String code;

    /**
     * 返回消息内容
     */
    private String message;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    /**
     * 成功消息 (有消息内容)
     */
    public ResultMessage success(String message){
        this.code = "SUCCESS";
        this.message = message;
        return this;
    }

    /**
     * 成功消息(无消息内容)
     */
    public ResultMessage success(){
        this.code = "SUCCESS";
        return this;
    }

    /**
     * 失败消息(无消息内容)
     */
    public ResultMessage error(String message){
        this.code = "error";
        this.message = message;
        return this;
    }

    /**
     * 失败消息(无消息内容)
     */
    public ResultMessage error(){
        this.code = "error";
        return this;
    }

}
